package com.share.zabbix.response;

import com.alibaba.fastjson.JSON;
import com.share.zabbix.entity.ZabbixItemEnum;

import lombok.Data;

import java.io.Serializable;

@Data
public class ZabbixResponseItem  implements Serializable{
    private static final long serialVersionUID = -8137828777615043559L;

    // TODO HELP https://www.zabbix.com/documentation/4.0/manual/api/reference/item/get

    private String itemid;
    private String type;
    private String hostid;
    private String name;
    private String desc;
    private String key_;
    private String delay;
    private String history;
    private String trends;
    private String lastvalue;
    private String lastclock;
    private String prevvalue;
    private String state;
    private String status;
    private String value_type;

    private String error;
    private String lastlogsize;
    private String logtimefmt;
    private String templateid;
    private String params;
    private String authtype;
    private String username;
    private String password;
    private String publickey;
    private String privatekey;
    private String mtime;
    private String lastns;
    private String flags;
    private String interfaceid;
    private String port;
    private String description;
    private String lifetime;
    private String master_itemid;
    private String timeout;


    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

    public String getDesc() {
        return ZabbixItemEnum.getItemDescByKey(key_);
    }
}
